package com.snjx.micro.oauth.user.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.snjx.micro.oauth.user.domain.UserDTO;
import com.snjx.micro.oauth.user.holder.LoginUserHolder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @Created by suonanjiexi
 * @Description TODO
 * @Date 2020/7/30 2:50 下午
 */
@RestController
@RequestMapping("/user")
@Api(value = "user接口", tags = "接口")
public class UserController{

    @Autowired
    private LoginUserHolder loginUserHolder;
    @ApiOperation(value = "创建用户", notes = "currentUser", produces = "application/json")
    @ApiOperationSupport(order = 1)
    @GetMapping("/currentUser")
    public UserDTO currentUser() {
        return loginUserHolder.getCurrentUser();
    }


    public static void main(String[] args) {
            double m=0.01;
            for (int i = 1; i < 31; i++) {
                if (i==1){
                    m=m;
                }else {
                    m = m * 2;
                }
                System.out.println("第"+i+"天  : "+m+" 元");
            }
    }
}